package wxy.studentmanage.service.impl;

import wxy.studentmanage.bean.Users;
import wxy.studentmanage.mapper.UserMapper;
import wxy.studentmanage.service.UserService;

import java.util.List;

public class UserServiceImpl implements UserService {
    //调用dao层的操作，设置一个set接口，方便Spring管理
    private UserMapper userMapper;

    public void setUserMapper(UserMapper userMapper) {
        this.userMapper = userMapper;
    }

    //查询所有
    @Override
    public List<Users> queryAllUser() {
        return userMapper.queryAllUser();
    }

    @Override
    public int addUser(Users users) {
        return userMapper.addUser(users);
    }

    @Override
    public int deleteUserById(int wxy_id) {
        return userMapper.deleteUserById(wxy_id);
    }

    @Override
    public Users queryUserById(int wxy_id) {
        return userMapper.queryUserById(wxy_id);
    }

    @Override
    public int updateUser(Users users) {
        return userMapper.updateUser(users);
    }

    @Override
    public Users login(String wxy_username, String wxy_password) {
        return userMapper.login(wxy_username,wxy_password);
    }
}
